package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ScStudentContactMapper;
import com.ruoyi.system.domain.ScStudentContact;
import com.ruoyi.system.service.IScStudentContactService;

/**
 * 联系人Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-31
 */
@Service
public class ScStudentContactServiceImpl implements IScStudentContactService 
{
    @Autowired
    private ScStudentContactMapper scStudentContactMapper;

    /**
     * 查询联系人
     * 
     * @param contactId 联系人主键
     * @return 联系人
     */
    @Override
    public ScStudentContact selectScStudentContactByContactId(Long contactId)
    {
        return scStudentContactMapper.selectScStudentContactByContactId(contactId);
    }

    /**
     * 查询联系人列表
     * 
     * @param scStudentContact 联系人
     * @return 联系人
     */
    @Override
    public List<ScStudentContact> selectScStudentContactList(ScStudentContact scStudentContact)
    {
        return scStudentContactMapper.selectScStudentContactList(scStudentContact);
    }

    /**
     * 新增联系人
     * 
     * @param scStudentContact 联系人
     * @return 结果
     */
    @Override
    public int insertScStudentContact(ScStudentContact scStudentContact)
    {
        scStudentContact.setCreateTime(DateUtils.getNowDate());
        return scStudentContactMapper.insertScStudentContact(scStudentContact);
    }

    /**
     * 修改联系人
     * 
     * @param scStudentContact 联系人
     * @return 结果
     */
    @Override
    public int updateScStudentContact(ScStudentContact scStudentContact)
    {
        return scStudentContactMapper.updateScStudentContact(scStudentContact);
    }

    /**
     * 批量删除联系人
     * 
     * @param contactIds 需要删除的联系人主键
     * @return 结果
     */
    @Override
    public int deleteScStudentContactByContactIds(Long[] contactIds)
    {
        return scStudentContactMapper.deleteScStudentContactByContactIds(contactIds);
    }

    /**
     * 删除联系人信息
     * 
     * @param contactId 联系人主键
     * @return 结果
     */
    @Override
    public int deleteScStudentContactByContactId(Long contactId)
    {
        return scStudentContactMapper.deleteScStudentContactByContactId(contactId);
    }
}
